Skip to content

WA-RAILS7-019: Webpacker removal strategy and migration guide#757

Merged
kitcommerce merged 1 commit intonextfrom
wa-rails7-019-webpacker-removal
Mar 5, 2026
Merged

WA-RAILS7-019: Webpacker removal strategy and migration guide#757
kitcommerce merged 1 commit intonextfrom
wa-rails7-019-webpacker-removal

Conversation

@kitcommerce
Copy link

Closes #750

Summary

  • Audited core/, admin/, and storefront/ for Webpacker/webpack references (none found).
  • Added Rails 7 migration docs covering:
    • Webpacker → Sprockets 4 (recommended default)
    • Optional jsbundling-rails (esbuild) + Sprockets approach for modern JS needs
  • Updated docs/templates to use --skip-javascript instead of the removed --skip-webpack-install flag.

Client impact

Informational. Clients upgrading to Rails 7 who previously used Webpacker need this guidance to migrate to Sprockets 4 (or optionally jsbundling-rails).

Docs

  • docs/rails7-migration-patterns/webpacker-to-sprockets-4.md
  • docs/rails7-migration-patterns/jsbundling-rails-esbuild.md

@kitcommerce kitcommerce added the gate:build-passed Build gate passed label Mar 5, 2026
@kitcommerce
Copy link
Author

architecture Review

Verdict: PASS

Documentation-only change that adds migration guides for downstream host applications moving from Webpacker to Sprockets 4 (or optionally jsbundling-rails). No code changes, no new dependencies, no API surface modifications. The recommended path (Sprockets 4) aligns with the existing Workarea asset pipeline architecture and preserves the engine/host-app boundary cleanly — host apps own their JS bundling strategy while the engine continues to serve assets via Sprockets. The optional jsbundling-rails path is correctly scoped as a host-app concern, not an engine dependency.

No findings.

@kitcommerce
Copy link
Author

security Review

Verdict: PASS

Documentation-only change adding migration guides for Webpacker removal. No source code, configuration files, or executable content was modified. No secrets, auth changes, input handling, or injection surfaces are introduced. The change carries zero security risk.

No findings.

@kitcommerce kitcommerce added review:architecture-pending Review in progress review:architecture-done Review complete review:security-pending Review in progress review:security-done Review complete review:rails-conventions-pending Rails conventions review in progress review:simplicity-pending Review in progress and removed review:architecture-pending Review in progress review:security-pending Review in progress labels Mar 5, 2026
@kitcommerce
Copy link
Author

Simplicity Review

Verdict: PASS_WITH_NOTES
Severity: LOW

The migration guides are clear, well-structured, and appropriately scoped. Steps are numbered, code blocks are practical, and the cross-linking between the two paths (Sprockets-only vs jsbundling) is well done. No over-engineering detected.

Minor Findings

  1. Ticket numbers in document headings — Both guide headings include (WA-RAILS7-019) (e.g. # Webpacker → Sprockets 4 (WA-RAILS7-019)). This is internal tracking noise that will be meaningless to downstream clients in 6 months. Recommend removing from H1 headings; it belongs in the PR body or a changelog, not in living docs.

  2. "Audit" section is PR metadata, not client guidancewebpacker-to-sprockets-4.md contains a section stating "As of this change, core/, admin/, and storefront/ do not reference Webpacker." That's a snapshot-in-time audit result for reviewers, not actionable guidance for clients doing a migration. Consider removing it or reframing as a note about what clients don't need to worry about engine-side.

  3. Horizontal rule overusejsbundling-rails-esbuild.md uses 4 --- dividers in 113 lines. The heading hierarchy already provides structure; the extra dividers add visual noise without clarity benefit.

What's Working Well

  • Steps are clear and ordered correctly
  • Code blocks are minimal and accurate
  • "When not to use this" section in the jsbundling guide is a nice touch — prevents over-engineering at the client level
  • --skip-webpack-install--skip-javascript flag updates are clean and correct
  • README index is appropriately minimal (10 lines)

No blocking issues. The minor items above can be addressed in a follow-up or as part of a doc polish pass.

@kitcommerce
Copy link
Author

Rails-Conventions Review

Verdict: PASS_WITH_NOTES ✅

Rails idioms and API usage throughout the migration guides are accurate. All recommended patterns align with Rails 7 best practices. No blocking issues found.


What's Correct

  • --skip-javascript flag (replacing --skip-webpack-install) — correct; this is the proper Rails 7 flag for skipping all JS tooling setup.
  • Sprockets 4 manifest syntax//= link_tree, //= link, //= link_tree ../builds directives are all correct Sprockets 4 conventions.
  • Helper method replacementsjavascript_pack_tagjavascript_include_tag and stylesheet_pack_tagstylesheet_link_tag are the correct Sprockets equivalents.
  • //= require directive syntax — correct usage for classic Sprockets-managed libraries.
  • bin/rails javascript:install:esbuild — correct; this is the actual rake task provided by jsbundling-rails.
  • jsbundling-rails two-step build (yarn build + bin/rails assets:precompile) — correct production/CI pattern.
  • Rails.application.config.assets.precompile += in config/initializers/assets.rb — valid Rails convention; correctly caveated with "prefer the manifest approach in Sprockets 4 where possible".

Notes (non-blocking)

  1. importmap-rails not mentioned. Rails 7's actual new default is importmap-rails, not Sprockets-for-JS. The guide's Sprockets 4 recommendation is correct for Workarea (given engine asset delivery is Sprockets-based), but a single sentence acknowledging the omission would help readers who've seen Rails 7 docs defaulting to importmaps — e.g. "importmap-rails is Rails 7's new default for greenfield apps, but Workarea host apps are better served by continuing with the Sprockets 4 asset pipeline."

  2. SCSS manifest linking. The manifest examples link application.css and application.js. If a host app has application.scss, the correct Sprockets 4 convention is still to link via the compiled output extension (//= link application.css). This implicit behavior isn't spelled out, but it's not wrong — just something readers may trip over.

  3. config/initializers/assets.rb placement. Valid convention, but some teams put asset precompile additions in config/application.rb or config/environments/production.rb. Either works; the guide's choice is defensible and common.


JSON Verdict

{
  "reviewer": "rails-conventions",
  "verdict": "PASS_WITH_NOTES",
  "severity": "LOW",
  "summary": "All Rails idioms, API names, manifest directives, helper methods, and build commands are accurate for Rails 7 + Sprockets 4. Three low-severity notes: importmap-rails could be briefly acknowledged as the Rails 7 default with an explanation of why Workarea sticks with Sprockets; SCSS manifest linking behavior is implicit; asset precompile config location is one of several valid options.",
  "findings": [
    {
      "severity": "LOW",
      "file": "docs/rails7-migration-patterns/webpacker-to-sprockets-4.md",
      "note": "importmap-rails (Rails 7 new default) not mentioned. Add a brief sentence explaining why Sprockets 4 is preferred over importmap for Workarea host apps."
    },
    {
      "severity": "LOW",
      "file": "docs/rails7-migration-patterns/webpacker-to-sprockets-4.md",
      "note": "Manifest example links application.css; if host app uses application.scss, Sprockets 4 still requires linking the compiled .css extension. Worth a clarifying note for SCSS users."
    },
    {
      "severity": "LOW",
      "file": "docs/rails7-migration-patterns/webpacker-to-sprockets-4.md",
      "note": "config/initializers/assets.rb is valid but not the only convention; config/application.rb is also common. No change required."
    }
  ]
}

@kitcommerce kitcommerce added review:simplicity-done Review complete review:rails-conventions-done Rails conventions review complete and removed review:simplicity-pending Review in progress review:rails-conventions-pending Rails conventions review in progress labels Mar 5, 2026
@kitcommerce
Copy link
Author

✅ Wave 1 Gate — PASSED

All 4 Wave 1 reviewers returned PASS or PASS_WITH_NOTES (all findings LOW severity).

Reviewer Verdict Severity
architecture PASS
security PASS
rails-conventions PASS_WITH_NOTES LOW
simplicity PASS_WITH_NOTES LOW

Advancing to Wave 2 (rails-security, database, test-quality).

@kitcommerce kitcommerce added review:rails-security-pending Rails security review in progress review:database-pending Database review in progress review:test-quality-pending Review in progress labels Mar 5, 2026
@kitcommerce
Copy link
Author

Rails Security Review (Wave 2)

Verdict: PASS

Findings

No findings. This PR contains only documentation (migration guides) and a minor template flag change (--skip-webpack-install--skip-javascript). No Ruby application code, controllers, models, views, routes, or configuration files are modified.

No Rails security attack surface is introduced or modified by this change.

Recommendations

None.

@kitcommerce
Copy link
Author

Database Review — Wave 2

Verdict: PASS

Findings

No findings. This PR contains only documentation (migration guides for Webpacker removal). There are no database migrations, schema changes, model changes, query modifications, or any Ruby code changes to review.

Recommendations

None.

@kitcommerce kitcommerce added review:rails-security-done Rails security review complete review:database-done Database review complete and removed review:rails-security-pending Rails security review in progress review:database-pending Database review in progress labels Mar 5, 2026
@kitcommerce
Copy link
Author

Test Quality Review (Wave 2)

{
  "reviewer": "test-quality",
  "verdict": "PASS",
  "severity": null,
  "summary": "Documentation-only PR with no new code, no modified tests, and no logic requiring test coverage.",
  "findings": []
}

No test coverage concerns. This PR adds only Markdown migration guides and a README index — there is no executable code to test. PASS.

@kitcommerce kitcommerce added review:test-quality-done Review complete and removed review:test-quality-pending Review in progress labels Mar 5, 2026
@kitcommerce
Copy link
Author

✅ Wave 2 Gate — PASSED

All 3 Wave 2 reviewers returned PASS.

Reviewer Verdict Severity
rails-security PASS
database PASS
test-quality PASS

All waves complete. Labeling merge:ready.

@kitcommerce kitcommerce added the merge:ready All conditions met, eligible for merge label Mar 5, 2026
@kitcommerce
Copy link
Author

✅ All Review Waves Passed

All reviewers returned PASS or PASS_WITH_NOTES. This PR is merge-ready.

  • Wave 1 (Foundation): ✅ arch PASS, security PASS, rails-conv PASS_WITH_NOTES LOW, simplicity PASS_WITH_NOTES LOW
  • Wave 2 (Correctness): ✅ rails-security PASS, database PASS, test-quality PASS

Labeled merge:ready. Auto-merge hold window started (60 min).

@kitcommerce kitcommerce added the merge:hold In hold window before auto-merge label Mar 5, 2026
@kitcommerce kitcommerce merged commit 393e5d9 into next Mar 5, 2026
14 of 15 checks passed
@kitcommerce kitcommerce deleted the wa-rails7-019-webpacker-removal branch March 5, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate:build-passed Build gate passed merge:hold In hold window before auto-merge merge:ready All conditions met, eligible for merge review:architecture-done Review complete review:database-done Database review complete review:rails-conventions-done Rails conventions review complete review:rails-security-done Rails security review complete review:security-done Review complete review:simplicity-done Review complete review:test-quality-done Review complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant